{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
    <div class="main">
        <!-- left side start-->
        {include admin.inc.menu}
        <!-- left side end-->


        <!-- main content start-->
        <section class="right-section" id="right-section">
            <!-- start of inner-frame -->
            <div class="inner-iframe">

                <!-- page breadcrumb start-->
                {include admin.inc.bread}
                <!-- page "breadcrumb end-->
                <!-- Nav tabs -->
                <ul class="nav nav-tabs">

                    <li><a href="{$add_url}"><i class="glyphicon glyphicon-plus"></i> 商品发布</a></li>
                    <li >
                        <a href="indexBySale.shtml"><i class="glyphicon glyphicon-th-list"></i>出售中的商品</a>
                    </li>
                    <li class="active">
                        <a href="indexByStore.shtml"><i class="glyphicon glyphicon-th-list"></i> 仓库中的商品</a>
                    </li>

                </ul>
                <div class="inner-container">
                    <form id="J_List_Form" class="form-inline search-form" role="form">
                        <input type="hidden" name="pagesize" value="{$pagesize}">
                        <div class="form-group">
                            <select name="select_mix_option1" class="form-control input-sm" data-value="{$search_arr[select_mix_option1]}">

                                <option value="product_no">货号</option>
                                <option value="type_name">分类</option>
                                <option value="product_name">品名</option>
                                <option value="factory_name">厂家</option>
                                <option value="brand_name">牌号</option>

                            </select>
                        </div>
                        <div class="form-group">
                            <div class="input-group">

                                <input type="text" class="form-control input-sm" maxlength="{maxlength}" placeholder="关键词" name="select_mix_option_value1" value="{$search_arr[select_mix_option_value1]}">
                            </div>
                        </div>

                        <div class="form-group">
                            <select name="delivery_way" class="form-control input-sm" data-value="{$search_arr[delivery_way]}">
                                <option value="all">-交收方式-</option>
                                <option value="0">卖家配送</option>
                                <option value="1">买家自提</option>
                            </select>
                        </div>

                        <input type="hidden" name="order" value="{$order}">
                        <button type="submit" class="btn btn-sm btn-success">搜索</button>
                        {run exportBtn()}
                        <!-- search form end -->
                    <!--</form>
                    <form id="J_List_Form">-->
                        <div class="table-responsive">
                            <table id="J_ListTable" class="table  table-hover  table-striped">
                                <!--tmpl-listtable-->

                                <!-- listblock -->
                                <thead>
                                <tr>
                                    <th width="20"><input type="checkbox" class="icheck check-all"/></th>
                                    <!--tmpl-fieldheaders-->

                                    <th>产品货号
                                    </th>
                                    <th>分类
                                    </th>
                                    <th>品名
                                    </th>
                                    <th>厂家
                                    </th>
                                    <th>牌号
                                    </th>
                                    <th>最小交易量({$pro_unit})
                                    </th>
                                    <th>数量({$pro_unit})
                                    </th>
                                    <th>冻结数量({$pro_unit})
                                    </th>
                                    <th>销售价(元/{$pro_unit})
                                    </th>
                                    <th>成本价(元/{$pro_unit})
                                    </th>
                                    <th>货品规格({$pro_std})
                                    </th>
                                    <th>交收方式
                                    </th>
                                    <th>状态
                                    </th>
                                    <th>仓库
                                    </th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {if empty($items)}
                                <tr>
                                    <td style="text-align:center;" colspan="8" class="empty-table-td">{$emptyRecord}
                                    </td>
                                </tr>
                                {/if}
                                {loop $items $value}
                                <tr data-id="{$value[id]}">
                                    <td><input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}"/></td>
                                    <!--tmpl-fieldlist-->

                                    <td>{$value[product_no]}</td>
                                    <td>{$value[type_name]}</td>
                                    <td>{$value[product_name]}</td>
                                    <td>{$value[factory_name]}</td>
                                    <td>{$value[brand_name]}</td>
                                    <td>{$value[min_volume]}</td>

                                    <td>{$value['quantity']}</td>

                                    <td>{$value[freeze_quantity]}</td>
                                    <td>{$value[sales_price]}</td>
                                    <td>{$value[cost_price]}</td>
                                    <td>{$value[pkg_size]}</td>

                                    <td>{$value[delivery_way]}</td>

                                    <td>{$value[status]}</td>

                                    <td>{$value[repertory_name]}</td>

                                    <td>
                                        {if in_array('admin/product/edit',$priv) || empty($priv)}
                                        <a href="{$edit_url}?id={$value[id]}&from={$from}" class="btn btn-primary btn-xs">
                                            <i class="glyphicon glyphicon-edit"></i> 编辑</a>
                                        {/if}
                                        {if in_array('admin/product/onshelf',$priv) || empty($priv)}

                                        <a href="javascript:;" class="btn btn-primary btn-xs js-on">
                                            <i class="glyphicon glyphicon-edit"></i> 上架</a>
                                        {/if}
                                        {if in_array('admin/product/delete',$priv) || empty($priv)}

                                        <a href="{$delete_url}?id={$value[id]}"
                                           class="btn btn-danger btn-xs item-remove">
                                            <i class="glyphicon glyphicon-trash"></i> 删除</a>
                                        {/if}




                                    </td>
                                </tr>
                                {/loop}


                            </table>

                        </div>

                    </form>
                    <div class="text-right" style="float: right">
                        {$pagemenu}
                    </div>
                    <div class="button-group pagination" style="float: left">
                        <select name="action-bacth-select"  disabled class="form-control input-sm" >
                            <option value="" checked="true">-批量操作-</option>
                            {if in_array('admin/product/onshelf',$priv) || empty($priv)}
                            <option value="on" >上架</option>
                            {/if}
                            {if in_array('admin/product/delete',$priv) || empty($priv)}
                            <option value="delete" >删除</option>
                            {/if}

                        </select>
                    </div>
                </div>
            </div>
        </section>
    </div>
</div>

<!--footer section start-->
{include admin.inc.footer}
<!--footer section end-->

<!--tmpl-script-->

<!-- template -->
<script id="editpanel" type="text/html">
    <div>
        <form id="editpanel-form" class="form-horizontal">
            <div class="row">&nbsp</div>
            <!--tmpl-fieldlist-->

            <!-- input -->
            <div class="form-group">
                <label>产品货号 </label>
                <input dtype="" class="form-control" maxlength="20" name="data[product_no]" placeholder="产品货号" required
                       cname="产品货号" value="{[product_no]}"/>
            </div>
            <p class="help-block"></p>

            <!-- password -->
            <div class="form-group">
                <label>计价类型</label>
                <input type="password" placeholder="计价类型" name="data[valuation_type]" id="inputvaluation_type"
                       class="form-control" value="{[valuation_type]}">
            </div>
            <p class="help-block"></p>

            <!-- input -->
            <div class="form-group">
                <label>数量(库存数量) </label>
                <input dtype="" class="form-control" maxlength="{maxlength}" name="data[quantity]"
                       placeholder="数量(库存数量)" required cname="数量(库存数量)" value="{[quantity]}"/>
            </div>
            <p class="help-block"></p>

            <!-- input -->
            <div class="form-group">
                <label>最小交易量 </label>
                <input dtype="" class="form-control" maxlength="{maxlength}" name="data[min_volume]" placeholder="最小交易量"
                       required cname="最小交易量" value="{[min_volume]}"/>
            </div>
            <p class="help-block"></p>

            <!-- input -->
            <div class="form-group">
                <label>销售价 </label>
                <input dtype="" class="form-control" maxlength="{maxlength}" name="data[sales_price]" placeholder="销售价"
                       required cname="销售价" value="{[sales_price]}"/>
            </div>
            <p class="help-block"></p>

            <!-- input -->
            <div class="form-group">
                <label>成本价 </label>
                <input dtype="" class="form-control" maxlength="{maxlength}" name="data[cost_price]" placeholder="成本价"
                       required cname="成本价" value="{[cost_price]}"/>
            </div>
            <p class="help-block"></p>


            <!--tmpl-assocfields-->
        </form>
    </div>
</script>

<!-- pagescript -->
<script type="text/javascript">
    seajs.use("admin/productindex", function (parameter) {

        /**--tmpl-templatejavascript--**/

        <!--tmpl-templatejavascript-->
        parameter.detailUrl = "{$detail_url}";
        parameter.doDeleteUrl = "{$do_delete_url}";
        parameter.editUrl = "{$do_edit_url}";
        parameter.doOnShelfUrl = "{url admin/product/do_onShelf}";

        parameter.image_search_url = "{$image_search_url}";
        parameter.image_list_url = "{$image_list_url}";

        parameter.init();
    });
</script>


<script id="assocpage" type="text/html">
    <div class="text-right">
        <ul class="pagination blog-pagination">
            <li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li>
            {[loop pages page]}

            <li {[if curr== page]}class="active" {[
            /if]}><a class="assoc-page" data-page="{[page]}" href="javascript:void(0)">{[page]}</a></li>

            {[/loop]}
            <li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li>
        </ul>
    </div>
</script>
</body>
</html>
